/*
 * @(#) $Header$
 *
 * Copyright (C) 2007  Daniel Léonard
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

package ca.forklabs.media.jai;

import java.text.MessageFormat;
import java.util.ResourceBundle;
import ca.forklabs.baselib.util.CharsetPropertiesControl;

/**
 * Class {@code Resources} is the default bundle for the resources used by
 * classes in the {@link ca.forklabs.media.jai} package.
 *
 * @author   <a href="mailto:forklabs at gmail.com?subject=ca.forklabs.media.jai.Resources">Daniel Léonard</a>
 * @version $Revision$
 */
@SuppressWarnings("nls")
class Resources {

//---------------------------
// Class variables
//---------------------------

   /** The key for a bad tile request. */
   public static final String RASTER_ADAPTER_BAD_TILE = "raster.adapter.bad.tile";

   /** Key for the error message saying the mode should have been a collection mode. */
   public static final String NEITHER_COLLECTION_NOR_RENDERABLE_COLLECTION_MODE = "neither.collection.nor.renderable.collection.mode";
   /** Key for the error message saying the not all the sources are rendered images. */
   public static final String NOT_ALL_RENDERED_IMAGE = "not.all.rendered.image";
   /** Key for the error message saying the not all the sources are renderable images. */
   public static final String NOT_ALL_RENDERABLE_IMAGE = "not.all.renderable.image";
   /** Key for the error message saying the operator does not have any enumerated parameters. */
   public static final String NO_ENUMERATED_PARAMETERS = "no.enumerated.parameters";
   /** Key for the error message saying that the parameter is unknown. */
   public static final String UNKNOWN_PARAMETER = "unknown.parameter";


//---------------------------
// Constructor
//---------------------------

   /**
    * Let no one instanciate this class.
    */
   private Resources() {
   // nothing
      }


//---------------------------
// Class method
//---------------------------

   /**
    * Gets the resource bundle itself.
    * @return   the resource bundle.
    */
   public static ResourceBundle getResourceBundle() {
      String name = Resources.class.getName();
      ResourceBundle bundle = ResourceBundle.getBundle(name, CharsetPropertiesControl.UTF_8_CONTROL);
      return bundle;
      }

   /**
    * Gets and formats the specified localized string from the menu resource
    * bundle.
    * @param   key   the key.
    * @param   arguments   the arguments to format the string.
    * @return   the value.
    */
   public static String getLocalizedString(String key, Object... arguments) {
      ResourceBundle bundle = Resources.getResourceBundle();
      String pattern = bundle.getString(key);
      String message = MessageFormat.format(pattern, arguments);
      return message;
      }

   }
